home *** CD-ROM | disk | FTP | other *** search
- /*
- * interface to mac mail check core routines
- * by Aaron Wohl (aw0g+@andrew.cmu.edu) jul 1990
- * Carnegie-Mellon University
- * Special Projects
- * Pittsburgh, PA 15213-3890
- * (412)-268-5032
- */
-
-
- #define TICKS (1L)
- #define SECS (60*TICKS) /*one second is this many ticks*/
- #define MINS (60*SECS)
- #define HOURS (60*MINS)
-
- #define DEFAULT_REMIND_TIME (15*MINS)
-
- #define MMC_uname_len (12) /*c string, first char is null if a user is not active*/
-
- #define MMC_ST_maj_ver (15)
- #define MMC_ST_min_ver (14)
-
- #define imax(xx_arg1,xx_arg2) (((xx_arg1)>(xx_arg2))?(xx_arg1):(xx_arg2))
- #define imin(xx_arg1,xx_arg2) (((xx_arg1)<(xx_arg2))?(xx_arg1):(xx_arg2))
-
- #define MMC_check_num (0x12E4572AL)
-
- /*
- * flags with [R] are read only and can not be set with
- * MCC_set_state
- * The other flags can be changed by MCC_stat_state.
- * the driver will also update them itself
- *
- * if MCS_u0 or MCS_u1 is set but its corrisponding string is not
- * then driver will turn it off
- */
- #define BIT(xx_arg) (1L<<((xx_arg)-1))
-
- #define MCS_snooze BIT(1) /*hit snooze button*/
- #define MCS_error BIT(2) /*some kind of error is present*/
- #define MCS_want_open BIT(3) /*would like to be open*/
- #define MCS_hearmm BIT(5) /*listen to mac mail when it sets the username*/
- #define MCS_io_pending BIT(8) /*[R]an async IO call is pending*/
- #define MCS_debug BIT(9) /*[R]an async IO call is pending*/
-
- #define MCS_unsaveable (MCS_debug|MCS_io_pending|MCS_snooze)
- /*
- * how to notify
- */
- #define MCS_nsound BIT(12)
- #define MCS_nblink BIT(13)
- #define MCS_npost BIT(14)
- #define MCS_nhow (MCS_nsound|MCS_nblink|MCS_npost)
-
- /*
- * snooze is setable but only via setmmuser
- */
- #define MCS_setable \
- (MCS_debug|MCS_want_open|MCS_hearmm|MCS_nhow)
-
- #define TURN_OFF_FLAGS(xx_where,xx_fl) do {(xx_where).mmc_st&= ~(xx_fl);} while(0)
- #define TURN_ON_FLAGS(xx_where,xx_fl) do {(xx_where).mmc_st|=(xx_fl);} while(0)
- #define FLSET(xx_where,xx_fl) ((((xx_where).mmc_st)&(xx_fl))!=0)
-
- #define MMC_MAX_STR (255) /*largest string to return*/
-
- #define DEFAULT_SOUND_ID (1) /*resource id of the default sound*/
-
- /*
- * published state
- */
- struct mmc_state_R {
- short mmc_st_maj_ver; /*major version number*/
- short mmc_st_min_ver; /*major version number*/
- short mmc_sound_id; /*resource id of sound to play*/
- short mmc_last_err_syserr; /*error code of last error*/
- short mmc_last_err_kind; /*MCE_ code*/
- long mmc_st; /*MCS_ state flags*/
- long mmc_remind_time; /*how often to remind users of mail*/
- char mmc_uname[MMC_uname_len]; /*usernames to check for, c strings*/
- char mmc_text_state[MMC_MAX_STR]; /*current state*/
- long mmc_check_num; /*for CDEV to stash its version info*/
- };
- typedef struct mmc_state_R mmc_state,*mmc_state_pt;
-
- /*
- * io manager control parameter block to pass to Control
- */
- struct mmc_io_record_R {
- void *qLink;
- short qType;
- short ioTrap;
- void *ioCmdAddr;
- void *ioCompletion;
- short ioResult;
- void *ioNamePtr;
- short ioVRefNum;
- short ioCRefNum;
- short csCode;
- void * private_state; /*returned with pointer to mmc private vars*/
- mmc_state iostate; /*state to set, current state returned*/
- };
- typedef struct mmc_io_record_R mmc_io_record,*mmc_io_record_pt;
-
- #define MMC_goodbye (-1) /*goodbye kiss, the heap is about to be initilized*/
- /* 0 unused*/
- #define MMC_killio 1 /*killio does this control entry to stop io*/
- #define MMC_get_state 2 /*read current driver state*/
- #define MMC_set_state 3 /*set current driver state*/
- #define MMC_setmmuser 4 /*set macmail user*/
-
- #define MMC_run 65 /*run periodic functions*/
-
- #define MCE_ISERR 0x020
-
- #define MCE_NOERRR 0 /*no error presend*/
- #define MCE_UDP_REL 1 /*udp release failed*/
- #define MCE_TOO_OLD 2 /*driver to old to talk to server*/
- #define MCE_UDP_READ 3 /*read failed*/
- #define MCE_UDP_CREATE 4 /*upd create failed*/
- #define MCE_MACTCP 5 /*mactcp open failed*/
- #define MCE_UDP_WRITE 6 /*udp write failed*/
- #define MCE_REM_ERR 7 /*remote error froms server*/
- #define MCE_TIMEOUT 8 /*no response from server*/
-
- /*
- * localy define a procedure with a prototype
- */
- #define LDEF(xx_arg) static xx_arg; static xx_arg
-
- /*
- * initialize a parameter block for a control coll
- */
- #define INIT_CPB(xx_pb,xx_ref,xx_cscode) \
- do {(xx_pb).ioCompletion=0; \
- (xx_pb).ioVRefNum=0; \
- (xx_pb).ioCRefNum=(xx_ref); \
- (xx_pb).csCode=(xx_cscode); \
- } while(0)
-